package com.lmc.forum.exception;

import com.lmc.forum.common.AppResult;

public class ApplicationException extends RuntimeException{

//    自定义错误
    protected AppResult errResult;

//    指定异常状态码、异常信息
    public ApplicationException(AppResult errResult) {
        super(errResult.getMessage());
        this.errResult = errResult;
    }

//    指定异常信息
    public ApplicationException(String message) {
        super(message);
    }

//    指定异常
    public ApplicationException(Throwable cause) {
        super(cause);
    }

//    指定异常信息、异常
    public ApplicationException(String message, Throwable cause) {
        super(message, cause);
    }

    public AppResult getErrResult() {
        return errResult;
    }
}
